package com.sskj.b70.p.activity;

import com.lzy.okgo.model.Response;
import com.sskj.b70.m.StockCoinBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.http.JsonCallBack;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.activity.MarketNewActivity;

import java.util.List;

/**
 * 行情
 *
 * @author Hey
 * created at 2018/4/2 18:16
 */
public class MarketPresenter extends BasePresenter<MarketNewActivity> {

    /**
     * 获取股票最新数据
     *
     * @param
     * @param code 编码
     */
    public void getNewInfo(String code) {
        httpService.getProduct(code)
                .execute(new JsonCallBack<HttpData<List<StockCoinBean>>>(this) {
                    @Override
                    protected void _onSuccess(Response<HttpData<List<StockCoinBean>>> response) {
                        mView.updateUI(response.body().getData().get(0).getStockProductVO());
                    }
                });
    }


}
